(function(){
	window.dataServices={
		openTable:function(basename, tableName , schema){try{
			var file = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile);
			file.append(basename+".sqlite");
			
			var dbTool=Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService);
			
			var db = dbTool.openDatabase(file);
			if(!db.tableExists(tableName))
				db.createTable(tableName, schema);
				
			return db;
		}catch(e){trace(e);}}
	};
})();